<template>
	<!-- <view class="flex">
		<view class="uni-stat--app-select"> -->
			<uni-data-select style="width:100%;" v-model="no" :localdata="deviceList" :clear="true"
				@change="Changedevice" >
			</uni-data-select>
		<!-- </view> -->
	<!-- </view> -->
</template>

<script>
	export default {
		data() {
			return {
				value: -1,
				d_type:-1,
				no:-1,
				loading : false,
				Datatype: [{
						value: 0,
						text: "图片"
					},
					{
						value: 1,
						text: "视频"
					},
				],
			}
		},
		props:{
			socket:{
				type:Object,
				require:true,
			},
			deviceList: {
				type: Object,
				required: true
			}
		},
		methods:
		{
			Changedevice(e) {
				// this.no = e;
				// this.$emit('changedevice',this.deviceList[this.no].value)
				// console.log(e)
				// this.socket.send({
				// 	data:
				// 		JSON.stringify({
				// 			d_no: this.deviceList[this.no].value,
				// 			type: 'changedevice',
				// 			value: 'Data',
				// 		})
				// })
				if(e!==''){
					this.no=e;
					this.$emit('changedevice', this.deviceList[this.no].value);
				}else{
					this.$emit('changedevice',null);
				}


			}
		}
	}
</script>

<style>
</style>